package com.seeyon.apps.kk.manager;

import com.alibaba.fastjson.JSONObject;

/**
 * 业务层可以使用的一些配置，具备一定的热加载能力
 * 
 * @author Administrator
 *
 */
public class KkConfigManager extends BaseManager {
	private String configFilePath = "kkConfigJson.ftl";
	private FreemarkFlowManager freemarkFlowManager;

	public FreemarkFlowManager getFreemarkFlowManager() {
		return freemarkFlowManager;
	}

	public void setFreemarkFlowManager(FreemarkFlowManager freemarkFlowManager) {
		this.freemarkFlowManager = freemarkFlowManager;
	}

	public String getConfigFilePath() {
		return configFilePath;
	}

	public void setConfigFilePath(String configFilePath) {
		this.configFilePath = configFilePath;
	}

	public synchronized JSONObject createKkConfig() {

		String resultJson = this.freemarkFlowManager.fltTemplateIntoString(configFilePath, null);
		return JSONObject.parseObject(resultJson);

	}

}
